#include "CSVReader.h"
using namespace std;
CSVReader::CSVReader(char* filename, int dataIn, int dataOut)
{
    this->filename  = filename;
    this->dataIn    = dataIn;
    this->dataOut   = dataOut;
}

//TODO return struct of data to learn
void CSVReader::getData()
{
    ifstream file ( filename );
    string date;
    string value;

    while ( file.good() )
    {
        if(getline ( file, date, ',') == 0)
            break;
        getline ( file, value);
        double numb;
        istringstream ( value ) >> numb;
        cout << numb << endl;
    }

    if(file.is_open())
        file.close();

}

CSVReader::~CSVReader()
{

}
